package com.example.dbmysql.service.impl;


import com.example.dbmysql.mapper.ConfigurationMapper;
import com.example.dbmysql.pojo.Configuration;
import com.example.dbmysql.result.Result;
import com.example.dbmysql.service.ConfigurationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

@Service
public class ConfigurationServiceImpl implements ConfigurationService {

    @Autowired
    private ConfigurationMapper configurationMapper;


    @Override
    public void edit(Configuration configuration) {
        configurationMapper.edit(configuration);
    }

    @Override
    public Configuration select() {
        return configurationMapper.select();
    }

    @Override
    public void update(Configuration configuration) {
        configuration.setUpdateTimer(LocalDateTime.now());
        configurationMapper.update(configuration);
    }
}
